package thread;

public class RaceCarTest {
	public static void main(String[] args) {
		RaceCar c1 = new RaceCar("坦克T300");
		RaceCar c2 = new RaceCar("GTR");
		RaceCar c3 = new RaceCar("五菱宏光");
		RaceCar c4 = new RaceCar("保时捷");
		
		c1.start();
		c2.start();
		c3.start();
		c4.start();
		
		// main线程睡眠等待所有车到终点
		try {
			Thread.sleep(5000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		System.out.println("--------------排名------------");
		for(RaceCar c : RaceCar.cars) {
			System.out.println(c);
		}
	}
}
